package com.xcity.pomelo.response;

import java.util.ArrayList;
import java.util.List;

import com.xcity.game.battle.res.ResStage;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class ResStageDifficultyListResponse extends Response {

	private int type;
	private List<ResStageInfo> list;
	public static class ResStageInfo{
		public int id;
		public int isPass;//0:未通过 1:已通过
		public int levelLimit;
		public ResStageInfo(ResStage stage){
			this.id = stage.getIndex();
			this.isPass = stage.getPassTime() > 0 ? 1 : 0;
			this.levelLimit = stage.getTemplate().getLevelLimit();
		}
	}
	public ResStageDifficultyListResponse(int serial, int type, List<ResStage> stageList) {
		super(serial);
		this.type = type;
		this.list = new ArrayList<ResStageInfo>(stageList.size());
		for(int i = 0; i < stageList.size(); i++){
			ResStageInfo stageInfo = new ResStageInfo(stageList.get(i));
			this.list.add(stageInfo);
		}
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public List<ResStageInfo> getList() {
		return list;
	}
	public void setList(List<ResStageInfo> list) {
		this.list = list;
	}
	
}
